{template 'common/header-base-new'}
<body>
<div class="head">
	<nav class="navbar navbar-default" role="navigation">
		<div class="container">
			<div class="navbar-header">
				<a class="navbar-brand" href="#"><span class="color-default">微</span>擎 <span class="label label-versions">标准版</span></a>
			</div>
			<div class="collapse navbar-collapse">
				<ul class="nav navbar-nav navbar-left">
					<li class="active">
						<a href="#">公众号</a>
					</li>
					<li>
						<a href="#">应用市场</a>
					</li>
					<li>
						<a href="#">系统管理</a>
					</li>
					<li>
						<a href="#">功能帮助</a>
					</li>
				</ul>

				<ul class="nav navbar-nav navbar-right">
					<li>
						<a href="#">提醒</a>
					</li>
					<li class="dropdown">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown">皮肤 <span class="caret"></span></a>
						<ul class="dropdown-menu" role="menu">
							<li>
								<a href="#">Action</a>
							</li>
							<li>
								<a href="#">Another action</a>
							</li>
							<li>
								<a href="#">Something else here</a>
							</li>
							<li class="divider"></li>
							<li>
								<a href="#">Separated link</a>
							</li>
						</ul>
					</li>
					<li class="dropdown">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown">马德坤 <span class="caret"></span></a>
						<ul class="dropdown-menu" role="menu">
							<li>
								<a href="#">Action</a>
							</li>
							<li>
								<a href="#">Another action</a>
							</li>
							<li>
								<a href="#">Something else here</a>
							</li>
							<li class="divider"></li>
							<li>
								<a href="#">Separated link</a>
							</li>
						</ul>
					</li>
				</ul>
			</div>
		</div>
	</nav>
</div>
<div class="main" ng-controller="MainCtrl" ng-cloak>
	<div class="container">
		<div class="caret-wxapp">
			<div class="panel panel-app">
				<div class="wxapp-head panel-heading">
					<!--头部信息-->
					<img src="./resource/images/9.png" alt="公众号头像" class="">
					<span class="wxapp-name">第一个微擎小程序</span>
					<span class="wxapp-version">v0.0.1</span>
					<div class="pull-right">
						<a href="" class="color-default">切换版本</a>
						<a href="" class="color-default">设计新版本</a>
						<a href="" class="color-default"><i class="fa fa-refresh"></i>切换小程序</a>
					</div>
					<!--end头部信息-->
				</div>
				<div class="panel-body">
					<div class="left-menu">
						<!--菜单列表-->
						<div class="panel panel-menu">
							<div class="panel-heading">
								首页设置<span class="fa fa-cog pull-right"></span>
							</div>
							<ul class="list-group">
								<li class="list-group-item" ng-class="{active : wxapp == 'slide'}" ng-click="wxapp = 'slide'">
									<a href=""><i class="fa fa-adjust"></i>幻灯片 </a>
								</li>
								<li class="list-group-item" ng-class="{active : wxapp == 'nav'}" ng-click="wxapp = 'nav'">
									<a href=""><i class="fa fa-adjust"></i>导航图标</a>
								</li>
								<li class="list-group-item" ng-class="{active : wxapp == 'recommend'}" ng-click="wxapp = 'recommend'">
									<a href=""><i class="fa fa-adjust"></i>推荐图片</a>
								</li>
								<li class="list-group-item" ng-class="{active : wxapp == 'category'}" ng-click="wxapp = 'category'">
									<a href=""><i class="fa fa-adjust"></i>分类设置</a>
								</li>
							</ul>
						</div>
						<div class="panel panel-menu">
							<div class="panel-heading">
								模块
							</div>
							<ul class="list-group">
								{loop $modules $module}
								<a href="{php echo url('home/welcome/ext', array('m' => $module['name']))}">
								<li class="list-group-item">
									<i class="fa fa-adjust"></i>{$module['title']}
								</li>
								</a>
								{/loop}
							</ul>
						</div>
						<!--end菜单列表-->
					</div>
					<div class="right-contnt">
						<div class="wxapp-slide-project">
							<!--预览-->
							<div class="wxapp-phone">
								<img src="./resource/images/iphone6.png" alt="" class="wxapp-phone-bg" />
								<!--预览内容-->
								<div class="wxapp-home-preview">
									<img src="./resource/images/173.png"/>
								</div>
								<!--end预览内容-->
							</div>
							<!--end预览-->
							<div class="wxapp-slide">
								<!--列表-->
								<div class="wxapp-slide-list"  ng-show="wxapp == 'slide'">
									<div class="slide-heading">
										幻灯片
									</div>
									<ul>
										{loop $slides $slide}
										<li>
											<div class="wxapp-slide-detail media">
												<div class="media-left media-middle slide-sort">
													{$slide['displayorder']}
												</div>
												<div class="media-left media-middle slide-img">
													<img src="{php echo tomedia($slide['thumb'])}"/>
												</div>
												<div class="media-body">
													<div class="slide-title">
														{$slide['title']}
													</div>
													<div class="slide-alter">
														<a href="" ng-click="slideedit({$slide['id']})" class="color-default">编辑</a>
														<a href="{php echo url('wxapp/manage/edit', array('id' => $slide['id'], 'operate' => 'delete', 'type' => 'slide'))}" onclick="return confirm('确认删除幻灯片吗');" class="color-default">删除</a>
													</div>
												</div>
											</div>
										</li>
										{/loop}
										<li class="slide-list-more">
											<a href=""  class="slide-add" ng-click="slideedit('add')">+</a>
										</li>
									</ul>
								</div>
								<div class="wxapp-slide-list" ng-show="wxapp == 'nav'">
									<div class="slide-heading">
										导航图标
									</div>
									<ul>
										{loop $navs $nav}
										<li>
											<div class="wxapp-slide-detail media">
												<div class="media-left media-middle slide-sort">
													{$nav['displayorder']}
												</div>
												<div class="media-left media-middle slide-img">
													<image src="{php echo tomedia($nav['icon'])}"></image>
													<icon class="{$nav['css']['icon']['icon']}"></icon>
												</div>
												<div class="media-body">
													<div class="slide-title">
														{$nav['name']}
													</div>
													<div class="slide-alter">
														<a href="" class="color-default" ng-click="navedit({$nav['id']})">编辑</a>
														<a href="{php echo url('wxapp/manage/edit', array('type' => 'nav', 'id' => $nav['id'], 'operate' => 'delete'))}" onclick="return confirm('确认删除导航吗？');" class="color-default slide-del">删除</a>
													</div>
												</div>
											</div>
										</li>
										{/loop}
										<li class="slide-list-more">
											<a href="" class="slide-add" ng-click="navedit('add')">+</a>
										</li>
									</ul>
								</div>
								<div class="wxapp-slide-list" ng-show="wxapp == 'recommend'">
									<div class="slide-heading">
										推荐
									</div>
									<ul>
										{loop $recommends $recommend}
										<li>
											<div class="wxapp-slide-detail media">
												<div class="media-left media-middle slide-sort">
													{$recommend['displayorder']}
												</div>
												<div class="media-left media-middle slide-img">
													<img src="{php echo tomedia($recommend['thumb'])}"/>
												</div>
												<div class="media-body">
													<div class="slide-title">
														{$recommend['title']}
													</div>
													<div class="slide-alter">
														<a href="" class="color-default" ng-click="recommendedit({$recommend['id']}, '{$recommend['pcate']}')">编辑</a>
														<a href="{php echo url('wxapp/manage/edit', array('operate' => 'delete', 'type' => 'article', 'id' => $recommend['id']))}" onclick="return confirm('确认删除推荐吗？')" class="color-default slide-del">删除</a>
													</div>
												</div>
											</div>
										</li>
										{/loop}
										<li class="slide-list-more">
											<a href="javascript:void(0)" class="slide-add" ng-click="recommendedit('add')">+</a>
										</li>
									</ul>
								</div>
								<div class="wxapp-slide-list" ng-show="wxapp == 'category'">
									<div class="slide-heading">
										分类设置
									</div>
									<ul>
										{loop $categorys $pcate}
										<li>
											<div class="wxapp-slide-detail media">
												<div class="media-left media-middle slide-sort">
													{$pcate['displayorder']}
												</div>
												<div class="media-left media-middle slide-img">
													<img src="{php echo tomedia($pcate['icon'])}"/>
												</div>
												<div class="media-body">
													<div class="slide-title">
														{$pcate['name']}
													</div>
													<div class="slide-alter">
														<a href="" class="color-default" ng-click="categoryedit({$pcate['id']})">编辑</a>
														<a href="{php echo url('wxapp/manage/edit', array('operate' => 'delete', 'type' => 'category', 'id' => $pcate['id']))}" onclick="return confirm('确定要删除此分类吗？')" class="color-default slide-del">删除</a>
														<a href="" ng-click="categoryedit('add', {$pcate['id']})" class="color-default slide-del">添加子分类</a>
													</div>
												</div>
											</div>
										</li>
										{loop $pcate['categorys']  $cate}
										<li>
											<div class="wxapp-slide-detail media">
												<div class="media-left media-middle slide-sort">
													{$cate['displayorder']}
												</div>
												<div class="media-left media-middle slide-img">
													<img src="{php echo tomedia($cate['icon'])}"/>
												</div>
												<div class="media-body">
													<div class="slide-son-title">
														{$cate['name']}
													</div>
													<div class="slide-alter">
														<a href="" class="color-default" ng-click="categoryedit({$cate['id']})">编辑</a>
														<a href="{php echo url('wxapp/manage/edit', array('operate' => 'delete', 'type' => 'category', 'id' => $cate['id']))}" onclick="return confirm('确定要删除此分类吗？')" class="color-default slide-del">删除</a>
													</div>
												</div>
											</div>
										</li>
										{/loop}
										{/loop}
										<li class="slide-list-more">
											<a href="javascript:void(0)" class="slide-add" ng-click="categoryedit('add')">+</a>
										</li>
									</ul>
								</div>
								<div class="wxapp-slide-edit" ng-show="wxapp == 'slideedit'">
									<div class="edit-heading">
										<a href="" class="go-back">
											<i class="fa fa fa-chevron-circle-left"></i>
										</a>
										<span class="color-gray">幻灯片列表 / </span>
										<span class="color-dark">新建幻灯片</span>
									</div>
									<form action="{php echo url('wxapp/manage/edit')}" method="post" class="form-defalut" enctype="multipart/form-data">
										<div class="form-defalut" ng-if="slideid == 'add'">
											<div class="form-group" >
												<label for="" class="control-label">标题</label>
												<div class="form_controls">
													<input type="text" required name="slide[title]" class="form-control input-slide-title"  placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">排序</label>
												<div class="form_controls">
													<input type="text" name="slide[displayorder]" class="form-control input-slide-sort" id="" placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">图片</label>
												<div class="form_controls">
													{php echo tpl_form_field_image('slide[thumb]', '')}
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">链接</label>
												<div class="form_controls">
													<input type="text" name="slide[url]" class="form-control input-slide-link" required placeholder="">
												</div>
											</div>
											<input type="submit" name="submit" value="添加" class="btn btn-primary" />
											<input type="hidden" name="token" value="{$_W['token']}" />
										</div>
										{loop $slides $slide}
										<div class="form-defalut" ng-if="slideid == {$slide['id']}">
											<div class="form-group" >
												<label for="" class="control-label">标题</label>
												<div class="form_controls">
													<input type="text" name="slide[title]" class="form-control input-slide-title" required value="{$slide['title']}" placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">排序</label>
												<div class="form_controls">
													<input type="text" name="slide[displayorder]" class="form-control input-slide-sort" id="" value="{$slide['displayorder']}" placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">图片</label>
												<div class="form_controls">
													{php echo tpl_form_field_image('slide[thumb]', $slide['thumb'])}
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">链接</label>
												<div class="form_controls">
													<input type="text" name="slide[url]" class="form-control input-slide-link" required value="{$slide['url']}" id="" placeholder="">
												</div>
											</div>
											<input type="submit" name="submit" value="提交" class="btn btn-primary" />
											<input type="hidden" name="token" value="{$_W['token']}">
											<input type="hidden" name="id" value="{$slide['id']}">
										</div>
										{/loop}
									</form>
								</div>
								<div class="wxapp-slide-edit" ng-show="wxapp == 'navedit'">
									<div class="edit-heading">
										<a href="" class="go-back">
											<i class="fa fa fa-chevron-circle-left"></i>
										</a>
										<span class="color-gray">导航列表 / </span>
										<span class="color-dark">新建导航图标</span>
									</div>
									<form action="{php echo url('wxapp/manage/edit')}" method="post" class="form-defalut" enctype="multipart/form-data">
										<div class="form-defalut" ng-if="navid == 'add'">
											<div class="form-group" >
												<label for="" class="control-label">标题</label>
												<div class="form_controls">
													<input type="text" name="nav[name]" required class="form-control input-slide-title"  placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">排序</label>
												<div class="form_controls">
													<input type="text" name="nav[displayorder]" class="form-control input-slide-sort" placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">图片</label>
												<div class="form_controls">
													{php echo tpl_form_field_image('nav[icon]', '')}
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">链接</label>
												<div class="form_controls">
													<input type="text" name="nav[url]" required class="form-control input-slide-link" id="" placeholder="">
												</div>
											</div>
											<input type="submit" name="submit"  value="添加" class="btn btn-primary" />
											<input type="hidden" name="token" value="{$_W['token']}" />
										</div>
										{loop $navs $nav}
										<div class="form-defalut" ng-if="navid == {php echo $nav['id']}">
											<div class="form-group" >
												<label for="" class="control-label">标题</label>
												<div class="form_controls">
													<input type="text" name="nav[name]" required class="form-control input-slide-title" value="{$nav['name']}" placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">排序</label>
												<div class="form_controls">
													<input type="text" name="nav[displayorder]" class="form-control input-slide-sort" id="" value="{$nav['displayorder']}" placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">图片</label>
												<div class="form_controls">
													{php echo tpl_form_field_image('nav[icon]', $nav['icon'])}
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">链接</label>
												<div class="form_controls">
													<input type="text" name="nav[url]" required class="form-control input-slide-link" value="{$nav['url']}" id="" placeholder="">
												</div>
											</div>
											<input type="submit" name="submit" id="" value="提交" class="btn btn-primary" />
											<input type="hidden" name="token" value="{$_W['token']}">
											<input type="hidden" name="id" value="{$nav['id']}">
										</div>
										{/loop}
									</form>
								</div>
								<div class="wxapp-slide-edit" ng-show="wxapp == 'recommendedit'">
									<div class="edit-heading">
										<a href="" class="go-back">
											<i class="fa fa fa-chevron-circle-left"></i>
										</a>
										<span class="color-gray">导航列表 / </span>
										<span class="color-dark">新建导航图标</span>
									</div>
									<form action="{php echo url('wxapp/manage/edit')}" method="post" class="form-defalut" enctype="multipart/form-data">
										<div class="form-defalut" ng-if="recommendid == 'add'">
											<div class="form-group" >
												<label for="" class="control-label">标题</label>
												<div class="form_controls">
													<input type="text" required name="recommend[title]" class="form-control input-slide-title"  placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">排序</label>
												<div class="form_controls">
													<input type="text" name="recommend[displayorder]" class="form-control input-slide-sort" id="" placeholder="">
												</div>
											</div>
											<div class="form-group form-inline">
												<label for="" class="control-label">分类</label>
												<div class="form_controls">
													<select class="form-control" name="recommend[pcate]" required onchange="change_category($(this))">
														<option value="" disabled>一级分类</option>
														{loop $categorys $cate}
														<option value="{$cate['id']}"}>{$cate['name']}</option>
														{/loop}
													</select>
													<select class="form-control" name="recommend[ccate]">
														<option>二级分类</option>
													</select>
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">图片</label>
												<div class="form_controls">
													{php echo tpl_form_field_image('recommend[thumb]')}
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">链接</label>
												<div class="form_controls">
													<input type="text" name="recommend[source]" required class="form-control input-slide-link" id="" placeholder="">
												</div>
											</div>
											<input type="submit" name="submit"  value="添加" class="btn btn-primary" />
											<input type="hidden" name="token" value="{$_W['token']}" />
										</div>
										{loop $recommends $recommend}
										<div class="form-defalut" ng-if="recommendid == {$recommend['id']}">
											<div class="form-group" >
												<label for="" class="control-label">标题</label>
												<div class="form_controls">
													<input type="text" name="recommend[title]"  required class="form-control input-slide-title" value="{$recommend['title']}" placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">排序</label>
												<div class="form_controls">
													<input type="text" name="recommend[displayorder]" class="form-control input-slide-sort" id="" value="{$recommend['displayorder']}" placeholder="">
												</div>
											</div>
											<div class="form-group form-inline">
												<label for="" class="control-label">分类</label>
												<div class="form_controls">
													<select class="form-control pcategory" name="recommend[pcate]" onchange="change_category($(this))">
														<option value="" disabled>一级分类</option>
														{loop $categorys $cate}
														<option value="{$cate['id']}" {if $recommend['pcate'] == $cate['id']}selected{/if}>{$cate['name']}</option>
														{/loop}
													</select>
													<select class="form-control" name="recommend[ccate]">
														<option>二级分类</option>
														{loop $categorys $cates}
														{loop $cates['categorys'] $categ}
														<option value="{$categ['id']}" ng-show="recommendpid == '{$categ['parentid']}'" ng-selected="{$categ['id']} == '{$recommend['ccate']}'">{$categ['name']}</option>
														{/loop}
														{/loop}
													</select>
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">图片</label>
												<div class="form_controls">
													{php echo tpl_form_field_image('recommend[thumb]', $recommend['thumb'])}
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">链接</label>
												<div class="form_controls">
													<input type="text" name="recommend[source]" required class="form-control input-slide-link" value="{$recommend['source']}" id="" placeholder="">
												</div>
											</div>
											<input type="submit" name="submit" id="" value="提交" class="btn btn-primary" />
											<input type="hidden" name="token" value="{$_W['token']}">
											<input type="hidden" name="id" value="{$recommend['id']}">
										</div>
										{/loop}
									</form>
								</div>
								<div class="wxapp-slide-edit" ng-show="wxapp == 'categoryedit'">
									<div class="edit-heading">
										<a href="" class="go-back">
											<i class="fa fa fa-chevron-circle-left"></i>
										</a>
										<span class="color-gray">导航列表 / </span>
										<span class="color-dark">新建导航图标</span>
									</div>
									<form action="{php echo url('wxapp/manage/edit')}" method="post" class="form-defalut" enctype="multipart/form-data">
										<div class="form-defalut" ng-if="categoryeditid == 'add' || (categoryparentid != '' && categoryparentid != unidefined)">
											<div class="form-group" >
												<label for="" class="control-label">标题</label>
												<div class="form_controls">
													<input type="text" required name="category[name]" class="form-control input-slide-title"  placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">排序</label>
												<div class="form_controls">
													<input type="text" name="catetory[displayorder]" class="form-control input-slide-sort" id="" placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">图片</label>
												<div class="form_controls">
													{php echo tpl_form_field_image('category[icon]')}
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">链接</label>
												<div class="form_controls">
													<input type="text" required name="category[linkurl]" class="form-control input-slide-link" id="" placeholder="">
												</div>
											</div>
											<input type="submit" name="submit" id="" value="添加"  class="btn btn-primary" />
											<input type="hidden" name="token" value="{$_W['token']}" />
											<input type="hidden" name="parentid" value="{{ categoryparentid }}" ng-if="categoryparentid != ''" />
										</div>
										{loop $categorys $pcate}
										<div class="form-defalut" ng-if="categoryeditid == {$pcate['id']}">
											<div class="form-group" >
												<label for="" class="control-label">标题</label>
												<div class="form_controls">
													<input type="text" required name="category[name]" class="form-control input-slide-title" value="{$pcate['name']}" placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">排序</label>
												<div class="form_controls">
													<input type="text" name="category[displayorder]" class="form-control input-slide-sort" value="{$pcate['displayorder']}" placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">图片</label>
												<div class="form_controls">
													{php echo tpl_form_field_image('category[icon]', $pcate['icon'])}
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">链接</label>
												<div class="form_controls">
													<input type="text" required name="category[linkurl]" class="form-control input-slide-link" value="{$pcate['linkurl']}"  placeholder="">
												</div>
											</div>
											<input type="submit" name="submit" value="提交" class="btn btn-primary" />
											<input type="hidden" name="token" value="{$_W['token']}">
											<input type="hidden" name="id" value="{$pcate['id']}">
										</div>
										{loop $pcate['categorys'] $ccate}
										<div class="form-defalut" ng-if="categoryeditid == {$ccate['id']}">
											<div class="form-group" >
												<label for="" class="control-label">标题</label>
												<div class="form_controls">
													<input type="text" required name="category[name]" class="form-control input-slide-title" value="{$ccate['name']}" placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">排序</label>
												<div class="form_controls">
													<input type="text" name="category[displayorder]" class="form-control input-slide-sort" value="{$ccate['displayorder']}" placeholder="">
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">图片</label>
												<div class="form_controls">
													{php echo tpl_form_field_image("category[icon]", $ccate['icon'])}
												</div>
											</div>
											<div class="form-group">
												<label for="" class="control-label">链接</label>
												<div class="form_controls">
													<input type="text" required name="category[linkurl]" class="form-control input-slide-link" value="{$ccate['linkurl']}" id="" placeholder="">
												</div>
											</div>
											<input type="submit" name="submit" value="提交" class="btn btn-primary" />
											<input type="hidden" name="token" value="{$_W['token']}">
											<input type="hidden" name="id" value="{$ccate['id']}">
										</div>
										{/loop}
										{/loop}
									</form>
								</div>
								<!--end列表-->
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
	require(['angular', 'layer'], function(){
		angular.module('editWxApp', []);
		angular.module('editWxApp').controller('MainCtrl', ['$scope', function($scope){
			$scope.wxapp = '{$_GPC['wxapp']}' == '' ? 'slide' : '{$_GPC['wxapp']}';
			$scope.slideedit = function (id) {
				$scope.wxapp = 'slideedit';
				$scope.slideid = id;
			};
			$scope.navedit = function (id) {
				$scope.wxapp = 'navedit';
				$scope.navid = id;
			};
			$scope.recommendedit = function (id,pid) {
				$scope.wxapp = 'recommendedit';
				$scope.recommendid = id;
				$scope.recommendpid = pid;
			};
			$scope.categoryedit = function (id, pid) {
				$scope.wxapp = 'categoryedit';
				$scope.categoryeditid = id;
				$scope.categoryparentid = pid;
			};
		}]);
		change_category = function (element) {
			$.post('{php echo url('wxapp/manage/edit', array('operate' => 'change_category'))}', {'categoryid' : element.val()}, function(data) {
				var data = $.parseJSON(data);
				var html = '<option  value="">二级分类</option>';
				var categorys = data.message.message;
				for (var i = 0; i < categorys.length; i++) {
					html += '<option value='+categorys[i]['id']+'>'+categorys[i]['name']+'</option>';
				}
				element.next().html(html);
			});
		};
		angular.bootstrap(document, ['editWxApp']);

	});
</script>
</body>
</html>